;(function ($,window,document,undefined){


	CP.APP_CP = function (){

		var _this = this;
		var html = '<div id="{0}"" class="{1}"></div>';
		this.$id = "app";
		this.$class = "container_CP";

		this.$el = null;

		//PAGE MODULE
		this.dashboardPage = null;
		//FACEBOOK 
		this.facebook = null;

		this.init = function (id) {
			console.log('APP INIT');

			html = html.format(MYLIB.constant.app_id,MYLIB.constant.app_class);
			this.$el  = $(html);
			this.$el.appendTo('#'+id);

			this.dashboardPage = new CP.Dashboard();
			this.dashboardPage.init();

			this.facebook = new CP.FacebookService();
			

			this.renderLayout();
		}

		this.renderLayout = function () {

			this.$el.append(this.dashboardPage.getElement());

			this.dashboardPage.rightModule.renderCanvas();

		}

	};

})(jQuery,window,document)